#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton * Button = new QPushButton(this);
    Button->setText("按钮");
    Button->move(200,200);

    connect(Button,&QPushButton::clicked,this,&Widget::handleClicked);
}

void Widget::handleClicked()
{
    this->setWindowTitle("按钮已经被按下");
}

Widget::~Widget()
{
    delete ui;
}
